<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>接口测试报告</title>
    <meta name="generator" content="HTMLTestRunner 0.8.2.2"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
    
<style type="text/css" media="screen">
body        { font-family: Microsoft YaHei,Tahoma,arial,helvetica,sans-serif;padding: 20px; font-size: 80%; }
table       { font-size: 100%; }
/* -- heading ---------------------------------------------------------------------- */
.heading {
    margin-top: 0ex;
    margin-bottom: 1ex;
}
.heading .description {
    margin-top: 4ex;
    margin-bottom: 6ex;
}
/* -- report ------------------------------------------------------------------------ */
#total_row  { font-weight: bold; }
.passCase   { color: #5cb85c; }
.failCase   { color: #d9534f; font-weight: bold; }
.errorCase  { color: #f0ad4e; font-weight: bold; }
.hiddenRow  { display: none; }
.testcase   { margin-left: 2em; }
</style>

</head>
<body >
<script language="javascript" type="text/javascript">
output_list = Array();
/*level 调整增加只显示通过用例的分类 --Findyou
0:Summary //all hiddenRow
1:Failed  //pt hiddenRow, ft none
2:Pass    //pt none, ft hiddenRow
3:All     //pt none, ft none
*/
function showCase(level) {
    trs = document.getElementsByTagName("tr");
    for (var i = 0; i < trs.length; i++) {
        tr = trs[i];
        id = tr.id;
        if (id.substr(0,2) == 'ft') {
            if (level == 2 || level == 0 ) {
                tr.className = 'hiddenRow';
            }
            else {
                tr.className = '';
            }
        }
        if (id.substr(0,2) == 'pt') {
            if (level < 2) {
                tr.className = 'hiddenRow';
            }
            else {
                tr.className = '';
            }
        }
    }
    //加入【详细】切换文字变化 --Findyou
    detail_class=document.getElementsByClassName('detail');
	//console.log(detail_class.length)
	if (level == 3) {
		for (var i = 0; i < detail_class.length; i++){
			detail_class[i].innerHTML="收起"
		}
	}
	else{
			for (var i = 0; i < detail_class.length; i++){
			detail_class[i].innerHTML="详细"
		}
	}
}
function showClassDetail(cid, count) {
    var id_list = Array(count);
    var toHide = 1;
    for (var i = 0; i < count; i++) {
        //ID修改 点 为 下划线 -Findyou
        tid0 = 't' + cid.substr(1) + '_' + (i+1);
        tid = 'f' + tid0;
        tr = document.getElementById(tid);
        if (!tr) {
            tid = 'p' + tid0;
            tr = document.getElementById(tid);
        }
        id_list[i] = tid;
        if (tr.className) {
            toHide = 0;
        }
    }
    for (var i = 0; i < count; i++) {
        tid = id_list[i];
        //修改点击无法收起的BUG，加入【详细】切换文字变化 --Findyou
        if (toHide) {
            document.getElementById(tid).className = 'hiddenRow';
            document.getElementById(cid).innerText = "详细"
        }
        else {
            document.getElementById(tid).className = '';
            document.getElementById(cid).innerText = "收起"
        }
    }
}
function html_escape(s) {
    s = s.replace(/&/g,'&amp;');
    s = s.replace(/</g,'&lt;');
    s = s.replace(/>/g,'&gt;');
    return s;
}
</script>
<div class='heading'>
<h1 style="font-family: Microsoft YaHei">接口测试报告</h1>
<p class='attribute'><strong>测试人员 : </strong> yanan.cheng</p>
<p class='attribute'><strong>开始时间 : </strong> 2020-01-24 21:39:32</p>
<p class='attribute'><strong>合计耗时 : </strong> 0:00:00.850404</p>
<p class='attribute'><strong>测试结果 : </strong> 共 8，通过 1，错误 7，通过率= 12.50%</p>

<p class='description'>SAAS测试报告</p>
</div>


<p id='show_detail_line'>
<a class="btn btn-primary" href='javascript:showCase(0)'>概要{ 12.50% }</a>
<a class="btn btn-danger" href='javascript:showCase(1)'>失败{ 0 }</a>
<a class="btn btn-success" href='javascript:showCase(2)'>通过{ 1 }</a>
<a class="btn btn-info" href='javascript:showCase(3)'>所有{ 8 }</a>
</p>
<table id='result_table' class="table table-condensed table-bordered table-hover">
<colgroup>
<col align='left' />
<col align='right' />
<col align='right' />
<col align='right' />
<col align='right' />
<col align='right' />
</colgroup>
<tr id='header_row' class="text-center success" style="font-weight: bold;font-size: 14px;">
    <td>用例集/测试用例</td>
    <td>总计</td>
    <td>通过</td>
    <td>失败</td>
    <td>错误</td>
    <td>详细</td>
</tr>

<tr class='errorClass warning'>
    <td>run_case_ddt.TestRunCaseDdt</td>
    <td class="text-center">8</td>
    <td class="text-center">1</td>
    <td class="text-center">0</td>
    <td class="text-center">7</td>
    <td class="text-center"><a href="javascript:showClassDetail('c1',8)" class="detail" id='c1'>详细</a></td>
</tr>

<tr id='ft1_1' class='none'>
    <td class='errorCase'><div class='testcase'>imooc_001____获取广告位</div></td>
    <td colspan='5' align='center'>
    <!--默认收起错误信息 -Findyou -->
    <button id='btn_ft1_1' type="button"  class="btn btn-danger btn-xs collapsed" data-toggle="collapse" data-target='#div_ft1_1'>错误</button>
    <div id='div_ft1_1' class="collapse"> 
    <!-- 默认展开错误信息 -Findyou 
    <button id='btn_ft1_1' type="button"  class="btn btn-danger btn-xs" data-toggle="collapse" data-target='#div_ft1_1'>错误</button>
    <div id='div_ft1_1' class="collapse in">-->
    <pre>
    
ft1_1: 接口名称==== 获取广告位
Traceback (most recent call last):
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Run/run_case_ddt.py", line 55, in test_main_case
    cookies = get_cookie_value('web')
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Utils/handle_cookie.py", line 20, in get_cookie_value
    data=read_json("/config/Cookie.json")
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Utils/handle_json.py", line 20, in read_json
    data = json.load(f)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ddt.py", line 145, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Run/run_case_ddt.py", line 150, in test_main_case
    excel_data.excel_write_data(i, 14, json.dumps(res, ensure_ascii=False))
UnboundLocalError: local variable 'res' referenced before assignment


    </pre>
    </div>
    </td>
</tr>

<tr id='ft1_2' class='none'>
    <td class='errorCase'><div class='testcase'>imooc_002____测试</div></td>
    <td colspan='5' align='center'>
    <!--默认收起错误信息 -Findyou -->
    <button id='btn_ft1_2' type="button"  class="btn btn-danger btn-xs collapsed" data-toggle="collapse" data-target='#div_ft1_2'>错误</button>
    <div id='div_ft1_2' class="collapse"> 
    <!-- 默认展开错误信息 -Findyou 
    <button id='btn_ft1_2' type="button"  class="btn btn-danger btn-xs" data-toggle="collapse" data-target='#div_ft1_2'>错误</button>
    <div id='div_ft1_2' class="collapse in">-->
    <pre>
    
ft1_2: 接口名称==== 测试
Traceback (most recent call last):
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Run/run_case_ddt.py", line 45, in test_main_case
    depend_data = get_data(is_depend)
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Utils/precondition_data.py", line 54, in get_data
    return get_depend_data(res_data, rule_data)
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Utils/precondition_data.py", line 39, in get_depend_data
    res_data = json.loads(res_data)  # 字符串转换成字典
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 341, in loads
    raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ddt.py", line 145, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Run/run_case_ddt.py", line 150, in test_main_case
    excel_data.excel_write_data(i, 14, json.dumps(res, ensure_ascii=False))
UnboundLocalError: local variable 'res' referenced before assignment


    </pre>
    </div>
    </td>
</tr>

<tr id='ft1_3' class='none'>
    <td class='errorCase'><div class='testcase'>imooc_003____新课程</div></td>
    <td colspan='5' align='center'>
    <!--默认收起错误信息 -Findyou -->
    <button id='btn_ft1_3' type="button"  class="btn btn-danger btn-xs collapsed" data-toggle="collapse" data-target='#div_ft1_3'>错误</button>
    <div id='div_ft1_3' class="collapse"> 
    <!-- 默认展开错误信息 -Findyou 
    <button id='btn_ft1_3' type="button"  class="btn btn-danger btn-xs" data-toggle="collapse" data-target='#div_ft1_3'>错误</button>
    <div id='div_ft1_3' class="collapse in">-->
    <pre>
    
ft1_3: 接口名称==== 新课程
Traceback (most recent call last):
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Run/run_case_ddt.py", line 45, in test_main_case
    depend_data = get_data(is_depend)
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Utils/precondition_data.py", line 54, in get_data
    return get_depend_data(res_data, rule_data)
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Utils/precondition_data.py", line 39, in get_depend_data
    res_data = json.loads(res_data)  # 字符串转换成字典
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 341, in loads
    raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ddt.py", line 145, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Run/run_case_ddt.py", line 150, in test_main_case
    excel_data.excel_write_data(i, 14, json.dumps(res, ensure_ascii=False))
UnboundLocalError: local variable 'res' referenced before assignment


    </pre>
    </div>
    </td>
</tr>

<tr id='ft1_4' class='none'>
    <td class='errorCase'><div class='testcase'>imooc_004____评价</div></td>
    <td colspan='5' align='center'>
    <!--默认收起错误信息 -Findyou -->
    <button id='btn_ft1_4' type="button"  class="btn btn-danger btn-xs collapsed" data-toggle="collapse" data-target='#div_ft1_4'>错误</button>
    <div id='div_ft1_4' class="collapse"> 
    <!-- 默认展开错误信息 -Findyou 
    <button id='btn_ft1_4' type="button"  class="btn btn-danger btn-xs" data-toggle="collapse" data-target='#div_ft1_4'>错误</button>
    <div id='div_ft1_4' class="collapse in">-->
    <pre>
    
ft1_4: 接口名称==== 评价
请求头部=======&gt; None
请求方式======== post
请求url=======&gt; https://e.vhall.com/api3/getdownrecommend
请求参数======&gt; {'username': '111114'}
这个结果是一个html===========&gt;
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ddt.py", line 145, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Run/run_case_ddt.py", line 152, in test_main_case
    raise e
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Run/run_case_ddt.py", line 65, in test_main_case
    code = str(res['code'])
TypeError: string indices must be integers


    </pre>
    </div>
    </td>
</tr>

<tr id='ft1_5' class='none'>
    <td class='errorCase'><div class='testcase'>imooc_005____课程信息</div></td>
    <td colspan='5' align='center'>
    <!--默认收起错误信息 -Findyou -->
    <button id='btn_ft1_5' type="button"  class="btn btn-danger btn-xs collapsed" data-toggle="collapse" data-target='#div_ft1_5'>错误</button>
    <div id='div_ft1_5' class="collapse"> 
    <!-- 默认展开错误信息 -Findyou 
    <button id='btn_ft1_5' type="button"  class="btn btn-danger btn-xs" data-toggle="collapse" data-target='#div_ft1_5'>错误</button>
    <div id='div_ft1_5' class="collapse in">-->
    <pre>
    
ft1_5: 接口名称==== 课程信息
请求头部=======&gt; None
请求方式======== post
请求url=======&gt; https://e.vhall.com/api3/getcourseintro
请求参数======&gt; {'username': '111115'}
这个结果是一个html===========&gt;
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ddt.py", line 145, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Run/run_case_ddt.py", line 152, in test_main_case
    raise e
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Run/run_case_ddt.py", line 65, in test_main_case
    code = str(res['code'])
TypeError: string indices must be integers


    </pre>
    </div>
    </td>
</tr>

<tr id='ft1_6' class='none'>
    <td class='errorCase'><div class='testcase'>imooc_006____播放列表</div></td>
    <td colspan='5' align='center'>
    <!--默认收起错误信息 -Findyou -->
    <button id='btn_ft1_6' type="button"  class="btn btn-danger btn-xs collapsed" data-toggle="collapse" data-target='#div_ft1_6'>错误</button>
    <div id='div_ft1_6' class="collapse"> 
    <!-- 默认展开错误信息 -Findyou 
    <button id='btn_ft1_6' type="button"  class="btn btn-danger btn-xs" data-toggle="collapse" data-target='#div_ft1_6'>错误</button>
    <div id='div_ft1_6' class="collapse in">-->
    <pre>
    
ft1_6: 接口名称==== 播放列表
请求头部=======&gt; None
请求方式======== post
请求url=======&gt; https://e.vhall.com/api3/getmedialist
请求参数======&gt; {'username': '111116'}
这个结果是一个html===========&gt;
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ddt.py", line 145, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Run/run_case_ddt.py", line 152, in test_main_case
    raise e
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Run/run_case_ddt.py", line 65, in test_main_case
    code = str(res['code'])
TypeError: string indices must be integers


    </pre>
    </div>
    </td>
</tr>

<tr id='ft1_7' class='none'>
    <td class='errorCase'><div class='testcase'>imooc_007____课程列表</div></td>
    <td colspan='5' align='center'>
    <!--默认收起错误信息 -Findyou -->
    <button id='btn_ft1_7' type="button"  class="btn btn-danger btn-xs collapsed" data-toggle="collapse" data-target='#div_ft1_7'>错误</button>
    <div id='div_ft1_7' class="collapse"> 
    <!-- 默认展开错误信息 -Findyou 
    <button id='btn_ft1_7' type="button"  class="btn btn-danger btn-xs" data-toggle="collapse" data-target='#div_ft1_7'>错误</button>
    <div id='div_ft1_7' class="collapse in">-->
    <pre>
    
ft1_7: 接口名称==== 课程列表
请求头部=======&gt; None
请求方式======== post
请求url=======&gt; https://e.vhall.com/api3/courselistinfo
请求参数======&gt; {'username': '111117'}
这个结果是一个html===========&gt;
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ddt.py", line 145, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Run/run_case_ddt.py", line 152, in test_main_case
    raise e
  File "/Users/chengyanan/PycharmProjects/interfaceTestDemo/Run/run_case_ddt.py", line 65, in test_main_case
    code = str(res['code'])
TypeError: string indices must be integers


    </pre>
    </div>
    </td>
</tr>

<tr id='pt1_8' class='hiddenRow'>
    <td class='passCase'><div class='testcase'>test_main_case_8__None__None__None__None__None__None__None__None__None__None__None__None__None__None_</div></td>
    <td colspan='5' align='center'><span class="label label-success success">通过</span></td>
</tr>

<tr id='total_row' class="text-center active">
    <td>总计</td>
    <td>8</td>
    <td>1</td>
    <td>0</td>
    <td>7</td>
    <td>通过率：12.50%</td>
</tr>
</table>

<div id='ending'>&nbsp;</div>
    <div style=" position:fixed;right:50px; bottom:30px; width:20px; height:20px;cursor:pointer">
    <a href="#"><span class="glyphicon glyphicon-eject" style = "font-size:30px;" aria-hidden="true">
    </span></a></div>
    
</body>
</html>
